<?php

include_once('./functions/functions.php');

$visit_id = $HTTP_POST_VARS['visit_id'];
$client_id = $HTTP_POST_VARS['client_id'];

$pres_is_1 = $HTTP_POST_VARS['pres_is_1'];
$pres_is_2 = $HTTP_POST_VARS['pres_is_2'];
$pres_is_3 = $HTTP_POST_VARS['pres_is_3'];
$pres_is_4 = $HTTP_POST_VARS['pres_is_4'];

$opt_1 = $HTTP_POST_VARS['opt_1'];
$opt_2 = $HTTP_POST_VARS['opt_2'];
$opt_3 = $HTTP_POST_VARS['opt_3'];
$opt_4 = $HTTP_POST_VARS['opt_4'];

$casew = $HTTP_POST_VARS['optCCD'];
$casew_name = $HTTP_POST_VARS['casew_name'];
$casew_org = $HTTP_POST_VARS['casew_org'];

$client_sig = $HTTP_POST_VARS['optClientSignature'];

$time_taken = $HTTP_POST_VARS['txtTimeTaken'];
$duty_worker = $HTTP_POST_VARS['txtInterviewer'];

$queryVisit = "
					INSERT INTO er_page2
			(
visit_id,
client_id,
pres_is_1,
pres_is_2,
pres_is_3,
pres_is_4,
opt_1,
opt_2,
opt_3,
opt_4,
casew,
casew_name,
casew_org,
client_sig,
time_taken,
duty_worker

)

					VALUES ('$visit_id',
					'$client_id',
					'$pres_is_1',
					'$pres_is_2',
					'$pres_is_3',
					'$pres_is_4',
					'$opt_1',
					'$opt_2',
					'$opt_3',
					'$opt_4',
					'$casew',
					'$casew_name',
					'$casew_org',
					'$client_sig',
					'$time_taken',
					'$duty_worker'
					)";

//echo $queryVisit;
					
$resultVisit = mysql_query($queryVisit);
if (mysql_error()) {
	echo "An error has occurred, please contact the system administrator with the following error messages:<p>";
	echo mysql_error();
	echo "</p>";
}
mysql_affected_rows();

echo "Page 2 Data Added Successfully";

include('./pages/visit_details.php'); ?>


